<!DOCTYPE html>
<html>
<head>
    <title>avalon.templateCache的应用</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <script src="../avalon1.5/avalon.js"></script>
    <script>
        avalon.templateCache["aaa.html"] = "<strong>dddddddddddd</strong>"
        avalon.templateCache["bbb.html"] = "<em>555555555555</em>"

        var model = avalon.define({
            $id: "test",
            adjust: function (tmpl) {
                return tmpl + "  " + (new Date - 0)
            },
            aaa: "aaa.html",
            change: function () {
                model.aaa = model.aaa === "aaa.html" ? "bbb.html" : "aaa.html"
            },
            test: function () {
                alert(avalon.templateCache["test_a.html"]);
                model.aaa = "test_a.html";
            }
        })
    </script>
</head>
<body ms-controller="test">
<div ms-include-src="aaa" data-include-loaded="adjust"></div>
<button type="button" ms-click="change">点我切换模板</button>

<div ms-include-src="'test_a.html'"></div>
<button ms-click="test">test</button>
</body>
</html>